package com.yinhe.music.yhmusic.adapter;

import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yinhe.music.yhmusic.R;
import com.yinhe.music.yhmusic.model.HeaderBean;

import java.util.List;

/**
 * Created by hasee on 2017/8/15.
 */

public class MyHeaderAdapter extends BaseQuickAdapter<HeaderBean, BaseViewHolder> {

    public MyHeaderAdapter(@Nullable List<HeaderBean> data) {
        super(R.layout.fragment_my_header, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, HeaderBean item) {
        helper.setText(R.id.fragment_my_header_title, item.getTitle())
                .setText(R.id.fragment_my_header_num, item.getCount())
                .setImageResource(R.id.fragment_my_header_img, item.getAvatar())
                .setVisible(R.id.red_point, item.isShowRedPoint());
    }
}
